



use "HS_Inequality_Panel.dta", clear


*Run Soloman Hsiang's Ado file for OLS Spatial HAC SEs
run "ols_spatial_HAC.do", nostop



*run regression to set estimating sample
eststo: reghdfe  DG DHome DLand lag1 HomeLag AllLag  ,  cluster(fips) absorb(STATEYEAR)
gen Sample2 = (e(sample)==1)


*Table 2: Panel Estimates of the Relationship between Homesteading and Land Inequality
********************************************************************************
********************************************************************************
********************************************************************************
eststo clear

*might drop this column
eststo: xi: ols_spatial_HAC  DG DHome  i.state  if DLan !=.,   lat(ycen) lon(xcen) timevar(year) panelvar(fips) dropvar distcutoff(150) lagcutoff(1) 

eststo: xi: ols_spatial_HAC  DG DHome   DLand  i.state if DLan !=.,   lat(ycen) lon(xcen) timevar(year) panelvar(fips) dropvar distcutoff(150) lagcutoff(1)


eststo: xi: ols_spatial_HAC  DG DHome DLand lag1 HomeLag AllLag   i.state if DLan !=.,   lat(ycen) lon(xcen) timevar(year) panelvar(fips) dropvar distcutoff(150) lagcutoff(1)



eststo: xi: ols_spatial_HAC  DG DHome  i.STATEYEAR    if DLan !=.,   lat(ycen) lon(xcen) timevar(year) panelvar(fips) dropvar distcutoff(150) lagcutoff(1)


eststo: xi: ols_spatial_HAC  DG DHome   DLand  i.STATEYEAR if DLan !=.,   lat(ycen) lon(xcen) timevar(year) panelvar(fips) dropvar distcutoff(150) lagcutoff(1)


eststo: xi: ols_spatial_HAC  DG DHome DLand lag1 HomeLag AllLag i.STATEYEAR   if DLan !=.,   lat(ycen) lon(xcen) timevar(year) panelvar(fips) dropvar distcutoff(150) lagcutoff(1)




esttab ,  label    se(a3) b(a3) star(* 0.1 ** 0.05 *** 0.01) ar2  replace  scalar(MDV) indicate("State FE = _Is*" "State X Year FE = _IS*" )





*Table A2: Panel Summary statistics
********************************************************************************
********************************************************************************
********************************************************************************

eststo clear
estpost sum lnGini pcthomestead DG DHome DLand  if Sample2 ==1

*still refining this...
esttab , cells("count mean sd min max")  nomtitle nonumber noobs





